Class: DataMapper::Audited::Audit

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/dm-audited.rb

Instance Method Summary collapse

Instance Method Details

#auditableObject



103
104
105
# File 'lib/dm-audited.rb', line 103

def auditable
  auditable_type.constantize.get(auditable_id)
end

#changesObject



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_paramsObject



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