|
|
|
@ -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 |
|
|
|
|
# the method on the model so that it can be used in the rabl template. |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
def custom_values_display_data |
|
|
|
|
custom_values.map do |custom_value| |
|
|
|
|
display_custom_value(custom_value) |
|
|
|
|
def custom_values_display_data(field_names) |
|
|
|
|
field_names.map do |field_name| |
|
|
|
|
custom_value_display(custom_values.find_by_custom_field_id(field_name.to_s.gsub('cf_',''))) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def display_custom_value(custom_value) |
|
|
|
|
def custom_value_display(custom_value) |
|
|
|
|
if !custom_value.nil? |
|
|
|
|
{ |
|
|
|
|
custom_field_id: custom_value.custom_field.id, |
|
|
|
|