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/accounts_helper.rb
2019-08-14 17:21:39 +05:00

25 lines
548 B
Ruby

# frozen_string_literal: true
module AccountsHelper
def account_link_or_none(account)
if account.nil?
translate :none
elsif policy(account).show?
link_to account.nickname, account
else
account.nickname
end
end
def staff_account_link_or_none(account)
if account.nil?
translate :none
elsif policy([:staff, account]).show?
link_to account.nickname, [:staff, account]
elsif policy(account).show?
link_to account.nickname, account
else
account.nickname
end
end
end