Skip to content
Browse files

Update for Rails 3.x

  • Loading branch information...
1 parent c68b8b3 commit e24986f65c3ca03774fd983faf5b6282b82e491d @pzupan committed Feb 13, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/simple_audit/simple_audit.rb
View
8 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'

0 comments on commit e24986f

Please sign in to comment.
Something went wrong with that request. Please try again.