« first day (2013 days earlier)      last day (1242 days later) » 

 
5 hours later…
9:07 AM
how to generate has many through by migration
 
 
5 hours later…
user2384183
1:55 PM
@Emmanu you'd probably create the necessary tables like anything else. so if you wanted there to be an Author model that had many Publisher records through the Book model, you'd create tables for authors, publishers, and books. assuming the Book model had belongs_to :author and belongs_to :publisher associations, then you'd be able to add has_many :books and has_many :publishers, through: :books to Author
 
user2384183
(in this case i'm assuming that there's important information on the "in-between" model [Book], but if there isn't, then there are other approaches you can take to reduce the code you're writing)
 
user2384183
hope that helps! let me know if you have any questions about that
 

« first day (2013 days earlier)      last day (1242 days later) »