Class: Permission

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/permission.rb

Instance Method Summary collapse

Instance Method Details

#display_nameObject



14
15
16
17
18
19
# File 'app/models/permission.rb', line 14

def display_name
    pr = (I18n.t "permissions.predicates.#{predicate.name}", default: predicate.name.titleize rescue nil)
    a = (I18n.t "permissions.actions.#{action.name}", default: action.name.titleize rescue nil)
    m = (I18n.t "activerecord.models.#{target.name}", count: 2, default: target.name.titleize rescue nil)
    [ pr, a, m ].join(" ")
end