remove unneeded Relation#all from Journal model

git-svn-id: http://svn.redmine.org/redmine/trunk@12727 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-27 02:17:57 +00:00
parent c489c28219
commit 3b3a7c50a9
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ class Journal < ActiveRecord::Base
def self.preload_journals_details_custom_fields(journals)
field_ids = journals.map(&:details).flatten.select {|d| d.property == 'cf'}.map(&:prop_key).uniq
if field_ids.any?
fields_by_id = CustomField.where(:id => field_ids).all.inject({}) {|h, f| h[f.id] = f; h}
fields_by_id = CustomField.where(:id => field_ids).inject({}) {|h, f| h[f.id] = f; h}
journals.each do |journal|
journal.details.each do |detail|
if detail.property == 'cf'