|
|
@ -719,16 +719,16 @@ class WorkPackage < ActiveRecord::Base |
|
|
|
# TODO RS: This probably isn't the right place for display helpers. It's convenient though to have |
|
|
|
# TODO RS: This probably isn't the right place for display helpers. It's convenient though to have |
|
|
|
# the method on the model so that it can be used in the rabl template. |
|
|
|
# the method on the model so that it can be used in the rabl template. |
|
|
|
def get_custom_value_display_data(custom_field) |
|
|
|
def get_custom_value_display_data(custom_field) |
|
|
|
display_custom_value(custom_values.find_by_custom_field_id(custom_field.id)) |
|
|
|
custom_value_display(custom_values.find_by_custom_field_id(custom_field.id)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def custom_values_display_data |
|
|
|
def custom_values_display_data(field_names) |
|
|
|
custom_values.map do |custom_value| |
|
|
|
field_names.map do |field_name| |
|
|
|
display_custom_value(custom_value) |
|
|
|
custom_value_display(custom_values.find_by_custom_field_id(field_name.to_s.gsub('cf_',''))) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def display_custom_value(custom_value) |
|
|
|
def custom_value_display(custom_value) |
|
|
|
if !custom_value.nil? |
|
|
|
if !custom_value.nil? |
|
|
|
{ |
|
|
|
{ |
|
|
|
custom_field_id: custom_value.custom_field.id, |
|
|
|
custom_field_id: custom_value.custom_field.id, |
|
|
|