>> puts IO.read('app/models/pending_user.rb')
class PendingUser < User
set_table_name 'pending_users'
end
have i overlooked? Rails 2.0.1...
AR only support single table inheritance, so what you're trying to do
won't work. set_table_name should probably raise an exception to
prevent you getting surprised like that though.
"If you don‘t have a type column defined in your table, single-table inheritance won‘t be triggered. In that case, it‘ll work just like normal subclasses with no special magic for differentiating between them or reloading the right type with find."
and, of course, i have no type field... and, in the source
ar/base.rb
1060 # True if this isn't a concrete subclass needing a STI type condition.
1061 def descends_from_active_record?
1062 if superclass.abstract_class?
1063 superclass.descends_from_active_record?
1064 else
1065 superclass == Base || !columns_hash.include?(inheritance_column)
1066 end
1067 end
which i was reading to be inline with the docs. also the code i posted has worked with previous versions of rails just fine...
I still am surprised it did work before, but assuming it did, and the
fix is simple, I'm happy to take a patch
well i may be on thin ice - not knowing what's really intended in the source - but, unless someone chimes in that it really is *not* supposed to work i'll have a go.
Considering that the docs say it should work, and the "least surprise" way
would be to allow subclassing to work normally, I think a patch would be
valuable.
Considering that the docs say it should work, and the "least surprise" way
would be to allow subclassing to work normally, I think a patch would be
valuable.