Project

General

Profile

Feature #1189 » Updated-the-QueryColumn-code-to-be-allow_multi-aware-v2.diff

ciaran jessup, 2010-08-20 17:03

View differences:

app/models/query.rb
65 65
  end
66 66
  
67 67
  def value(issue)
68
    cv = issue.custom_values.detect {|v| v.custom_field_id == @cf.id}
69
    cv && @cf.cast_value(cv.value)
68
    value= nil
69
    if @cf.allow_multi
70
      cva = issue.custom_values.find_all {|v| v.custom_field_id == @cf.id}
71
      if cva.length >0
72
        value= cva.join(", ")
73
      end
74
    else
75
      cv= (issue.custom_values.detect {|v| v.custom_field_id == @cf.id})
76
      value= cv.value unless cv.nil?
77
    end
78
    value && @cf.cast_value(value)
70 79
  end
71 80
end
72 81

  
(3-3/8)