Skip to content
This repository was archived by the owner on Aug 10, 2019. It is now read-only.
This repository was archived by the owner on Aug 10, 2019. It is now read-only.

Allow for nested attributes for audit #21

@mguymon

Description

@mguymon

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions