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

23 lines
539 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module PeopleHelper
2019-08-14 12:18:18 +00:00
def staff_person_link_or_none(person)
if person.nil?
translate :none
elsif policy([:staff, person]).show?
link_to person.full_name, [:staff, person]
else
person.full_name
end
end
def person_status(person)
if person.nil? || person.current_relationship.nil?
return translate :not_in_party, scope: %i[helpers person_status]
end
translate person.current_relationship.status,
scope: %i[helpers person_status]
end
end