rails/rails — comment on commit f1a534af98950efd9969deea1540717c4516d673
File: activerecord/lib/active_record/attribute_methods.rb line 32
By jonleighton:

Hmmmm.....

Usually if two classes have the same `base_class` then they use the same DB table, therefore they will have exactly the same `generated_attribute_methods` (as the generated methods are 1-1 with the columns of the table).

However, I suppose someone could do this:

``` ruby
class A < AR::Base
self.table_name = 'foo'
end

class B < A
self.table_name = 'bar'
end
```

Should that be supported? It's pretty fucked up.

Potentially we could also change `base_class` to pay attention to the `table_name` (such that `A.base_class == A` and `B.base_class == B` in the above example). I think that would deal with it, but I need to think about the implications a bit more.

Thoughts welcome...