DEV Community

MD: HAFIZUL ISLAM
MD: HAFIZUL ISLAM

Posted on

Has Many Relations with Eager Load in Rails and also where conditions

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)

Collapse
 
sloan profile image
Sloan the DEV Moderator

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.