Class: DataMapper::Audited::Audit
- Inherits:
-
Object
- Object
- DataMapper::Audited::Audit
- Includes:
- Resource
- Defined in:
- lib/dm-audited.rb
Instance Method Summary collapse
- #auditable ⇒ Object
- #changes ⇒ Object
- #changes=(properties) ⇒ Object
- #request_params ⇒ Object
- #request_params=(params) ⇒ Object
Instance Method Details
#auditable ⇒ Object
103 104 105 |
# File 'lib/dm-audited.rb', line 103 def auditable auditable_type.constantize.get(auditable_id) end |
#changes ⇒ Object
111 112 113 |
# File 'lib/dm-audited.rb', line 111 def changes @changes_hash ||= Mash.new(JSON.load(attribute_get(:changes))) end |
#changes=(properties) ⇒ Object
107 108 109 |
# File 'lib/dm-audited.rb', line 107 def changes=(properties) attribute_set(:changes, properties.to_json) end |
#request_params ⇒ Object
119 120 121 122 |
# File 'lib/dm-audited.rb', line 119 def request_params @request_params_hash ||= Mash.new(JSON.load(attribute_get(:request_params))) @request_params_hash end |
#request_params=(params) ⇒ Object
115 116 117 |
# File 'lib/dm-audited.rb', line 115 def request_params=(params) attribute_set(:request_params, params.to_json) end |