Updated-the-QueryColumn-code-to-be-allow_multi-aware.diff

ciaran jessup, 2010-08-17 18:30

Download (663 Bytes)

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
      value= (issue.custom_values.detect {|v| v.custom_field_id == @cf.id}).value
76
    end
77
    value && @cf.cast_value(value)
70 78
  end
71 79
end
72 80