@@ -148,7 +148,7 class Journal < ActiveRecord::Base | |||
|
148 | 148 | def self.preload_journals_details_custom_fields(journals) |
|
149 | 149 | field_ids = journals.map(&:details).flatten.select {|d| d.property == 'cf'}.map(&:prop_key).uniq |
|
150 | 150 | if field_ids.any? |
|
151 |
fields_by_id = CustomField. |
|
|
151 | fields_by_id = CustomField.where(:id => field_ids).all.inject({}) {|h, f| h[f.id] = f; h} | |
|
152 | 152 | journals.each do |journal| |
|
153 | 153 | journal.details.each do |detail| |
|
154 | 154 | if detail.property == 'cf' |
General Comments 0
You need to be logged in to leave comments.
Login now