|
|
@ -716,26 +716,25 @@ class WorkPackage < ActiveRecord::Base |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
# Begin Custom Value Display Helper Methods |
|
|
|
# Begin Custom Value Display Helper Methods |
|
|
|
|
|
|
|
# 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) |
|
|
|
def get_custom_value_display_data(custom_field) |
|
|
|
custom_value = custom_values.find_by_custom_field_id(custom_field.id) |
|
|
|
display_custom_value(custom_values.find_by_custom_field_id(custom_field.id)) |
|
|
|
if !custom_value.nil? |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
custom_field_id: custom_field.id, |
|
|
|
|
|
|
|
field_format: custom_field.field_format, |
|
|
|
|
|
|
|
value: custom_value.value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def custom_values_display_data |
|
|
|
def custom_values_display_data |
|
|
|
custom_values.map do |custom_value| |
|
|
|
custom_values.map do |custom_value| |
|
|
|
if !custom_value.nil? |
|
|
|
display_custom_value(custom_value) |
|
|
|
{ |
|
|
|
end |
|
|
|
custom_field_id: custom_value.custom_field.id, |
|
|
|
end |
|
|
|
field_format: custom_value.custom_field.field_format, |
|
|
|
|
|
|
|
value: custom_value.value |
|
|
|
def display_custom_value(custom_value) |
|
|
|
} |
|
|
|
if !custom_value.nil? |
|
|
|
end |
|
|
|
{ |
|
|
|
|
|
|
|
custom_field_id: custom_value.custom_field.id, |
|
|
|
|
|
|
|
field_format: custom_value.custom_field.field_format, |
|
|
|
|
|
|
|
value: custom_value.value |
|
|
|
|
|
|
|
} |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
# End Custom Value Display Helper Methods |
|
|
|
# End Custom Value Display Helper Methods |
|
|
|