Closed tpickett66 closed 14 years ago
This can happen when alias_method gets called more than once. I fixed it by wrapping the two alias_method lines in ActsAsArchive::Migration with
unless method_defined?(:method_missing_without_archive)
alias_method :method_missing_without_archive, :method_missing
alias_method :method_missing, :method_missing_with_archive
end
That did the trick.
Merged these changes and released a new gem version. Thanks again, Ethan.
When doing rake db:schema:load to init a new development database, the acts_as_archive gem was the source of a stack level too deep problem:
ethan-viziteis-imac-2:therapylogs ethan$ rake db:schema:load --trace (in /Users/ethan/Documents/Rails/git/therapylogs) * Invoke db:schema:load (first_time) * Invoke environment (first_time) * Execute environment * Execute db:schema:load rake aborted! stack level too deep /Users/ethan/Documents/Rails/git/therapylogs/vendor/gems/acts_as_archive-0.2.4/lib/acts_as_archive/migration.rb:20:in
method_missing_without_archive' /Users/ethan/Documents/Rails/git/therapylogs/vendor/gems/acts_as_archive-0.2.4/lib/acts_as_archive/migration.rb:20:in
method_missing' /Users/ethan/Documents/Rails/git/therapylogs/db/schema.rb:14 /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activerecord/lib/active_record/schema.rb:43:ininstance_eval' /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activerecord/lib/active_record/schema.rb:43:in
define' /Users/ethan/Documents/Rails/git/therapylogs/db/schema.rb:12 /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:inload_without_new_constant_marking' /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in
load' /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in' /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in
load' /Users/ethan/Documents/Rails/git/therapylogs/vendor/rails/railties/lib/tasks/databases.rake:269 /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
execute' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
execute' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in
synchronize' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
invoke' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:ineach' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:inrun' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:inrun' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in
load' /usr/bin/rake:19 ethan-viziteis-imac-2:therapylogs ethan$Commenting out my requirement of the gem let me build my database, so there's a workaround, but just wanted to let you know.