Class: Faalis::Permission

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/faalis/permission.rb

Instance Method Summary collapse

Instance Method Details

#id_reprObject


34
35
36
# File 'app/models/faalis/permission.rb', line 34

def id_repr
  "#{self.permission_type.to_s}|#{self.model}"
end

#model_nameObject


38
39
40
# File 'app/models/faalis/permission.rb', line 38

def model_name
  model.underscore.humanize
end

#to_sObject

alias_method :action, :permission_type


29
30
31
32
# File 'app/models/faalis/permission.rb', line 29

def to_s
  t('permission_string', action: t(self.permission_type.to_s),
    model: t(self.model.underscore.humanize))
end