Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/simple_audit/simple_audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module ClassMethods
def simple_audit(options = {}, &block)
class_eval do

write_inheritable_attribute :username_method, (options[:username_method] || :name).to_sym
class_inheritable_reader :username_method
class_attribute :username_method
self.username_method = (options[:username_method] || :name).to_sym

attributes_and_associations = proc do |record|
changes = record.attributes
Expand All @@ -57,8 +57,8 @@ def simple_audit(options = {}, &block)
changes
end
audit_changes_proc = block_given? ? block.to_proc : attributes_and_associations
write_inheritable_attribute :audit_changes, audit_changes_proc
class_inheritable_reader :audit_changes
class_attribute :audit_changes
self.audit_changes = audit_changes_proc

has_many :audits, :as => :auditable, :class_name => '::SimpleAudit::Audit'

Expand Down