lundi 6 avril 2015

Active Record Grouping in Ruby On Rails


Vote count:

0





record = #<ActiveRecord::AssociationRelation
[#<User id: 2, store_id: 3,location: 'xxx'>,
#<User id: 4, store_id: 3,location:'yyy'>,
#<User id: 5, store_id: 4,location:'zzz'>,
#<User id: 6, store_id: 4,location:'aaa'> ]>


How to group in ruby to get the result as,



#< store_id: 3,location:'yyy,xxx'>
#< store_id: 4,location:'zzz,aaa'>


asked 2 mins ago







Active Record Grouping in Ruby On Rails

Aucun commentaire:

Enregistrer un commentaire