]> source.dussan.org Git - redmine.git/commitdiff
remove unneeded Relation#all from Journal model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 02:17:57 +0000 (02:17 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 27 Jan 2014 02:17:57 +0000 (02:17 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12727 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/journal.rb

index 46aa5aa9f90c7b4ecd15c23e9688e7002cbc13a0..79fbbb6ca4ef4250d5d3f5c3e61bda21b5183ed4 100644 (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'