Too many nested associations?

36 views
Skip to first unread message

fugee ohu

unread,
Mar 22, 2020, 10:46:59 AM3/22/20
to Ruby on Rails: Talk
i have user has_many press_releases and also user has_many artists and also artists have_many tours and also artists have_many press_releases Now I wanna create a tour and then a press_release for the tour The tour is made up of tour_dates, just in case you're wondering Complicating things is that user has_many press_releases as: :poster so that means all models in the chain of has_many_through need to include poster_type and poster_id I'm not sure where to use associations I'm tempted to bypass them and just use PressRelease.create(... or PressRelease.find_or_create_by(... in a controller regardless of the associations Should I use nested forms all the way to create press_releases or the direct Model.create method
Reply all
Reply to author
Forward
0 new messages