We discuss has many relations in rails, so consider two tables one is authors and the other books table. Firstly, we create two tables with model and with migrations. One writer has many books but we consider that one book written by one writer.
where condition with relations table
https://www.cstutorial.org/ruby-on-rails/has-many-relations-with-eager-load-in-rails
Top comments (1)
Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers don’t have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.
If you choose to do so, you also have the option to add a canonical URL directly to your post.