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

- (Object) id_repr



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

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

- (Object) model_name



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

def model_name
  model.underscore.humanize
end

- (Object) to_s

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