Gareth, I too wasn''t too happy with some aspects of STI, but to be fair
the constraints are pointed out in the Agile Rails book.
I am going to try the following for the scenarion where a number of z
subclasses inherit from a single y class which in turn inherits from a
single x class, and where z subclasses may be very different from
eachother.
The solution I plan to try is:
1) One controller with a new() action that instantiates the base class
(x) and correct subclasses (y,z) for the input form data (using a
''type'' selected in the UI)
2) Create action that saves x and thru table association (e.g. has one,
belongs to) saves the appropriate subclasses (y,z).
3) Individual models - one for x and y, and one for each sub class z.
Regards,
Lee.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---