This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/helpers/admin/user_helper.rb

17 lines
377 B
Ruby

module Admin::UserHelper
def show_attribute(object, field_id, locale = '')
attribute = object.attribute_values.detect {|av| av.attribute_field_id.eql?(field_id) || av[locale.to_s].eql?(locale.to_s) } rescue nil
if attribute
if locale.to_s.blank?
attribute['key']
else
attribute[locale.to_s]
end
else
''
end
end
end