Forum: Ruby on Rails STI and Inheritance

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ben R. (Guest)
on 2006-02-22 18:27
(Received via mailing list)
Hello ~

I have run into an issue with some of my objects not behaving as I
expect.
Basically I am using STI on my Users table and have several types of
users.

BaseUser
--UserType1 < BaseUser
--UserType2 < BaseUser
etc....

Recently when I create a UserType object and save it to the database it
ignores the validation rules for the parent class BaseUser.  Furthermore
the
after_validation method in the BaseUser was not being triggered if I
did:

after_validation :run_this

I had to call the run_this method after_validation to get it to trigger.

Any suggestions or thoughts on this would be greatly appreciated.

Thx,
This topic is locked and can not be replied to.