Two Tables Serving as one Model in Rails
Posted
by matsko
on Stack Overflow
See other posts from Stack Overflow
or by matsko
Published on 2010-06-18T02:17:13Z
Indexed on
2010/06/18
2:23 UTC
Read the original article
Hit count: 300
Is is possible in rails to setup on model which is dependant on a join from two tables? This would mean that for the the model record to be found/updated/destroyed there would need to be both records in both database tables linked together in a join. The model would just be all the columns of both tables wrapped together which may then be used for the forms and so on. This way when the model gets created/updated it is just one form variable hash that gets applied to the model?
Is this possible in Rails 2 or 3?
© Stack Overflow or respective owner