Permalink
Browse files

prevent infinite aliasing loop when loaded more than once

  • Loading branch information...
1 parent f4f306a commit 4e6bab852b144b6cbafb49e92d94284eb5bac5f1 Ethan Vizitei committed May 7, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/acts_as_archive/migration.rb
@@ -6,8 +6,10 @@ def self.included(base)
base.send :extend, ClassMethods
base.class_eval do
class <<self
- alias_method :method_missing_without_archive, :method_missing
- alias_method :method_missing, :method_missing_with_archive
+ unless method_defined?(:method_missing_without_archive)
+ alias_method :method_missing_without_archive, :method_missing
+ alias_method :method_missing, :method_missing_with_archive
+ end
end
end
end

0 comments on commit 4e6bab8

Please sign in to comment.