In my controller I have this and it works.
@grouped_by_assignable = collection.order("updated_at desc").group_by
{ |assignment| assignment.assignable }
trying to refactor it into a scope on the model as such
scope :grouped_by_assignable, order("updated_at desc").group_by { |
assignment| assignment.assignable }
yields
ArgumentError: Unknown key: #<Project:0x00000102dd5d80>
Any advice?
Thanks,
- FJM
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.