]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated find_all_by_* at Journal model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 15:55:03 +0000 (15:55 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 7 Jan 2014 15:55:03 +0000 (15:55 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12499 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/journal.rb

index eb4f9499ff14e1109facc3c78fe7f2b8ef7ce0f2..46aa5aa9f90c7b4ecd15c23e9688e7002cbc13a0 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.find_all_by_id(field_ids).inject({}) {|h, f| h[f.id] = f; h}
+      fields_by_id = CustomField.where(:id => field_ids).all.inject({}) {|h, f| h[f.id] = f; h}
       journals.each do |journal|
         journal.details.each do |detail|
           if detail.property == 'cf'