diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/discussion.rb | 2 | ||||
-rw-r--r-- | app/models/note.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/discussion.rb b/app/models/discussion.rb index 6a92b8eef66..9b32d573387 100644 --- a/app/models/discussion.rb +++ b/app/models/discussion.rb @@ -21,7 +21,7 @@ class Discussion end def self.build_collection(notes, context_noteable = nil) - grouped_notes = notes.includes(:noteable).group_by { |n| n.discussion_id(context_noteable) } + grouped_notes = notes.group_by { |n| n.discussion_id(context_noteable) } grouped_notes.values.map { |notes| build(notes, context_noteable) } end diff --git a/app/models/note.rb b/app/models/note.rb index 60257aac93b..832c68243fb 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -110,7 +110,7 @@ class Note < ActiveRecord::Base end def discussions(context_noteable = nil) - Discussion.build_collection(fresh, context_noteable) + Discussion.build_collection(all.includes(:noteable).fresh, context_noteable) end def find_discussion(discussion_id) |