Module: ActsAsLoggable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/acts_as_loggable.rb
Defined Under Namespace
Modules: Base, ClassMethods
Instance Method Summary collapse
- #log_changes_datatable ⇒ Object
-
#log_changes_formatted_attribute(attribute) ⇒ Object
Format the title of this attribute.
-
#log_changes_formatted_value(attribute, value) ⇒ Object
Format the value of this attribute.
Instance Method Details
#log_changes_datatable ⇒ Object
67 68 69 |
# File 'app/models/concerns/acts_as_loggable.rb', line 67 def log_changes_datatable EffectiveLogChangesDatatable.new(changes_to_id: id, changes_to_type: self.class.name) if persisted? end |
#log_changes_formatted_attribute(attribute) ⇒ Object
Format the title of this attribute. Return nil to use the default attribute.titleize
58 59 60 |
# File 'app/models/concerns/acts_as_loggable.rb', line 58 def log_changes_formatted_attribute(attribute) 'Roles' if attribute == :roles_mask && defined?(EffectiveRoles) && respond_to?(:roles) end |
#log_changes_formatted_value(attribute, value) ⇒ Object
Format the value of this attribute. Return nil to use the default to_s
63 64 65 |
# File 'app/models/concerns/acts_as_loggable.rb', line 63 def log_changes_formatted_value(attribute, value) EffectiveRoles.roles_for(value) if attribute == :roles_mask && defined?(EffectiveRoles) && respond_to?(:roles) end |