Cleanup obj_desc_and_link

This commit is contained in:
Nishanth Vijayan 2016-08-18 01:28:40 +05:30
parent 7d70f7685e
commit 75ee1371de
3 changed files with 138 additions and 140 deletions

View file

@ -21,10 +21,12 @@
- model_name = attribute.chomp('_id').camelize
- if version.event != 'create'
%td
= object_last_description(model_name, values[0])
- associated_object = current_or_last_object_state(model_name, values[0])
= associated_object.try(:title) || associated_object.try(:name)
= "(ID: #{values[0].blank? ? '-' : values[0]})"
%td
= object_last_description(model_name, values[1])
- associated_object = current_or_last_object_state(model_name, values[1])
= associated_object.try(:title) || associated_object.try(:name)
= "(ID: #{values[1].blank? ? '-' : values[1]})"
- else
@ -42,7 +44,8 @@
- if attribute.include?('_id')
- model_name = attribute.chomp('_id').camelize
%td
= object_last_description(model_name, value)
- associated_object = current_or_last_object_state(model_name, value)
= associated_object.try(:title) || associated_object.try(:name)
= "(ID: #{value.blank? ? '-' : value})"
- else
%td= value.blank? ? '-' : value