Module: Relational::Audit::ClassMethod
- Defined in:
- lib/relational/audit.rb
Instance Method Summary collapse
- #audit_entities ⇒ Object
- #audit_entities=(audit_entities) ⇒ Object
- #audit_options ⇒ Object
- #audit_options=(audit_options) ⇒ Object
- #belongs_to_audit(audit_entities, audit_options = {}) ⇒ Object
- #relational_audit(audit_options = {}) ⇒ Object
Instance Method Details
#audit_entities ⇒ Object
134 135 136 |
# File 'lib/relational/audit.rb', line 134 def audit_entities self.class_variable_get :@@audit_entities end |
#audit_entities=(audit_entities) ⇒ Object
138 139 140 |
# File 'lib/relational/audit.rb', line 138 def audit_entities=(audit_entities) self.class_variable_set :@@audit_entities, (audit_entities.is_a?(Array) ? audit_entities : [audit_entities]) end |
#audit_options ⇒ Object
142 143 144 |
# File 'lib/relational/audit.rb', line 142 def self.class_variable_get :@@audit_options end |
#audit_options=(audit_options) ⇒ Object
146 147 148 |
# File 'lib/relational/audit.rb', line 146 def () self.class_variable_set :@@audit_options, end |
#belongs_to_audit(audit_entities, audit_options = {}) ⇒ Object
158 159 160 161 162 163 164 165 |
# File 'lib/relational/audit.rb', line 158 def belongs_to_audit audit_entities, ={} self.audit_entities = audit_entities self. = unless .blank? after_create :add_created_child_audit after_update :add_updated_child_audit after_destroy :add_destroyed_child_audit end |
#relational_audit(audit_options = {}) ⇒ Object
150 151 152 153 154 155 156 |
# File 'lib/relational/audit.rb', line 150 def relational_audit ={} self. = unless .blank? after_create :add_created_relational_audit after_update :add_updated_relational_audit after_destroy :add_destroyed_relational_audit end |