I want to extend Audit record with some more information from the auditable type instance.
I've extended Audit behavior by config/initializers/audited.rb
class AuditExtension < Audited::Audit
before_save :resolve_association
def resolve_association
puts auditable_id
puts auditable_type
x = auditable_type.constantize.find(auditable_id)
...
end
end
Audited.config do |config|
config.audit_class = AuditExtension
end
Is there any other way how can I get the instance of the class which is audited except the way of x
initialization?