1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/helpers/relationships_helper.rb

32 lines
750 B
Ruby
Raw Normal View History

2019-08-14 22:10:12 -04:00
# frozen_string_literal: true
module RelationshipsHelper
def relationship_from_date_or_none(relationship)
if relationship&.from_date.blank?
2019-08-28 14:21:35 -04:00
none
else
localize relationship.from_date, format: :long
end
end
2019-08-14 22:41:34 -04:00
def relationship_status_or_none(relationship)
translate_enum :relationship_status, relationship&.status || false
2019-08-14 22:10:12 -04:00
end
2019-08-14 23:35:04 -04:00
def relationship_position_or_none(relationship)
if relationship&.position.nil?
2019-08-28 14:21:35 -04:00
none
2019-08-14 23:35:04 -04:00
else
translate_enum :relationship_position, relationship.position
end
end
2019-08-14 23:40:34 -04:00
def relationship_short_position_or_none(relationship)
if relationship&.position.nil?
2019-08-28 14:21:35 -04:00
none
2019-08-14 23:40:34 -04:00
else
translate_enum :relationship_short_position, relationship.position
end
end
2019-08-14 22:10:12 -04:00
end