Project

General

Profile

Patch #15072 » RM_15072_optimization_not_reload_custom_field_V2.3.2.diff

Jérôme BATAILLE, 2013-10-09 12:24

View differences:

app/helpers/issues_helper.rb (copie de travail)
220 220
    options[:only_path] = (options[:only_path] == false ? false : true)
221 221
    strings = []
222 222
    values_by_field = {}
223
    # Smile specific : optimization, do not reload the custom field multiple time
224
    cfs = {}
223 225
    details.each do |detail|
224 226
      if detail.property == 'cf'
225 227
        field_id = detail.prop_key
226
        field = CustomField.find_by_id(field_id)
228
        # Smile specific : optimization
229
        field = cfs[field_id]
230
        if field.nil?
231
          field = CustomField.find_by_id(field_id)
232
          cfs[field_id] = field
233
        end
234
        # END -- Smile specific : optimization
227 235
        if field && field.multiple?
228 236
          values_by_field[field_id] ||= {:added => [], :deleted => []}
229 237
          if detail.old_value
    (1-1/1)