auditable icon indicating copy to clipboard operation
auditable copied to clipboard

Allow for nested attributes for audit

Open mguymon opened this issue 12 years ago • 1 comments

Allow for nested attributes for an audit. Since the trailing hash is expected to the options, maybe by passing in a block? Something along the lines of:

audit :before_create => :create_audit_callback do 
  audit_attr :name, :arg, :lumox
  audit_attr :user, [:name, :login_at]
  audit_attr :notifications, { :messages => [:title, :sender] }
  audit_attr :cart, { :items => { :inventory => :price } }
end
  1. audit_attr :name, :arg, :lumox - Would allow attributes for the model to be added by array
  2. audit_attr :user, [:name, :login_at] - Would allow the user attribute to specify what attributes should be serialized by array
  3. audit_attr :notifications, { :messages => [:title, :sender] } - Would allow the nested attribute (:messages) to specify what should be serialized.
  4. audit_attr :cart, { :items => { :inventory => :price } } - Would allow to specify attributes as an array or single symbol (:inventory)

mguymon avatar Aug 13 '13 16:08 mguymon

+1

NullVoxPopuli avatar Mar 28 '14 14:03 NullVoxPopuli