diff --git a/app/models/milestone.rb b/app/models/milestone.rb index da54ac402df..a8619954017 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -11,7 +11,7 @@ class Milestone < ActiveRecord::Base end def participants - User.where(id: issues.map(&:assignee_id)) + User.where(id: issues.pluck(:assignee_id)) end def percent_complete diff --git a/app/models/project.rb b/app/models/project.rb index 0652d187ddd..5c82b7006bd 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -147,7 +147,7 @@ class Project < ActiveRecord::Base end def wiki_notes - Note.where(noteable_id: wikis.map(&:id), noteable_type: 'Wiki', project_id: self.id) + Note.where(noteable_id: wikis.pluck(:id), noteable_type: 'Wiki', project_id: self.id) end def project_id