From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 02:17:57 +0000 (+0000) Subject: remove unneeded Relation#all from Journal model X-Git-Tag: 2.5.0~173 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3b3a7c50a97224de1016a93a9c7685ad7ffb9095;p=redmine.git remove unneeded Relation#all from Journal model git-svn-id: http://svn.redmine.org/redmine/trunk@12727 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/journal.rb b/app/models/journal.rb index 46aa5aa9f..79fbbb6ca 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -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'