From fad7da308054facdb744e3d0bdf7e942d9ad354a Mon Sep 17 00:00:00 2001 From: pzupan Date: Mon, 13 Feb 2012 13:52:44 -0800 Subject: [PATCH] Update for Rails 3.x --- lib/simple_audit/simple_audit.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/simple_audit/simple_audit.rb b/lib/simple_audit/simple_audit.rb index 5090015..f2bc4d2 100644 --- a/lib/simple_audit/simple_audit.rb +++ b/lib/simple_audit/simple_audit.rb @@ -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 @@ -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'