Class: Guts::Authorization

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/guts/authorization.rb

Overview

Authorizations model

Instance Method Summary collapse

Instance Method Details

#class_with_actionObject

Shows a class with an action



12
13
14
15
16
17
# File 'app/models/guts/authorization.rb', line 12

def class_with_action
  string = "#{self[:subject_class]} (#{self[:action]})"
  string << " for ID: #{self[:subject_id]}" if self[:subject_id]

  string
end

#class_with_action_cleanerObject

Shows a cleaner class with an action



21
22
23
# File 'app/models/guts/authorization.rb', line 21

def class_with_action_cleaner
  class_with_action.gsub(/Guts::/, '').titleize
end