On Jul 5, 2015, at 11:45 AM, Padmahas Bn <padmahas@gmail.com> wrote:
> I think as you said I have to specify association between tables so that it would be easy to query without headache.
Yes, but for your own understanding of this, you need to stop thinking in terms of tables -- they are an implementation detail in Rails (unless you are dealing with a legacy schema). The relationship is between Model classes, not the tables that persist them. Define both sides of the relationship in your models, and Rails will make the rest of it trivial to reason about.
Walter
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/F6831523-2640-48B7-AC37-0C3AC11DFCE2%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment