acts_as_archive icon indicating copy to clipboard operation
acts_as_archive copied to clipboard

problem when associated class is using devise

Open AlperKarapinar opened this issue 14 years ago • 10 comments

Hello,

I m getting method_missing for 'devise' method error when i try to archive a class which belongs to another devise class. When i comment out the association line everything is ok. How can i fix this? Thanks..

AlperKarapinar avatar Feb 03 '11 14:02 AlperKarapinar

Same issue.

elmatou avatar Feb 11 '11 12:02 elmatou

Its sad that i had to give up trying to fix this. We were working on an urgent project last week. I will try fix this issue as soon as i ll have time. Thank you for your great work. Loved this gem.

AlperKarapinar avatar Feb 14 '11 11:02 AlperKarapinar

:(

aaronchi avatar Feb 17 '11 03:02 aaronchi

@Winton (or anybody who want to help).

I'ill be glad to help in solving this issue. here under a summarized trace of the app.

=> Rails 2.3.11 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:1998:in `method_missing': undefined method `devise' for #<0xb6665ce0>

elmatou avatar Mar 02 '11 15:03 elmatou

Hi everybody, I fixed this issue, but it chunk the loading process. Anybody with this issue would want to see my fork : https://github.com/elmatou/acts_as_archive/tree/manual-loading check the readme for explanation. (this fork fix also issue 24)

elmatou avatar Mar 15 '11 09:03 elmatou

You can also try the following if using Rails 3. This gets around the method missing issue but I'm now getting other errors (Possibly related to STI, still investigating)

in Gemfile: gem 'acts_as_archive', :require => nil

in config/initializers/acts_as_archive.rb Rails.application.config.after_initialize do require 'acts_as_archive' end

jnimety avatar Mar 22 '11 19:03 jnimety

Hi Joel, This did'nt worked for me (R1.8.9, r2.3.11+ Bundler ) that is why I forked the gem. It looks like Bundler require the lib even when :require => nil is passed. there is a common issue with polymorphic assocation maybe it is yours. issue 24 + patch : https://github.com/winton/acts_as_archive/pull/26

elmatou avatar Mar 22 '11 21:03 elmatou

Thanks elmatou, indeed it was the polymorphic association issue.

jnimety avatar Mar 25 '11 13:03 jnimety

:require => nil works for me. Rails 3

divineforest avatar Oct 06 '11 09:10 divineforest

@winton, can you merge elmatou's changes into master?

GAV1N avatar Jan 10 '12 03:01 GAV1N