When displaying changes, use '-' if id of associated object is blank

This commit is contained in:
Nishanth Vijayan 2016-08-20 15:45:53 +05:30
parent 75ee1371de
commit b30afccfba
2 changed files with 4 additions and 3 deletions

View file

@ -23,11 +23,11 @@
%td
- 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]})"
= values[0].blank? ? '-' : "(ID: #{values[0]})"
%td
- 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]})"
= (values[1].blank? ? '-' : "(ID: #{values[1]})")
- else
- if version.event != 'create'
@ -46,6 +46,6 @@
%td
- associated_object = current_or_last_object_state(model_name, value)
= associated_object.try(:title) || associated_object.try(:name)
= "(ID: #{value.blank? ? '-' : value})"
= value.blank? ? '-' : "(ID: #{value})"
- else
%td= value.blank? ? '-' : value