Colin Law wrote in post #1152183: > On 11 July 2014 22:26, Jan Yo <li...@ruby-forum.com> wrote: >> Here's the active record relation: >> >> customer has many memberships >> membership_role belongs to membership and role (link table) >> >> Is there a more compact, cleaner way to write this? > > Specify membership has_many roles through membership_role, then you > can use membership.roles, which helps a bit. > > Colin
I was looking for better, more compact code after the for statement. -- Posted via http://www.ruby-forum.com/. -- 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+unsubscr...@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/327628d0fee1ec8a56a5942353f82978%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.