Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

related/follower incompatible with devise #8

Open
jspaper opened this issue Jun 6, 2012 · 1 comment
Open

related/follower incompatible with devise #8

jspaper opened this issue Jun 6, 2012 · 1 comment
Assignees

Comments

@jspaper
Copy link

jspaper commented Jun 6, 2012

My environment:

  • ruby 1.9.3-p125
  • rails 3.2.5
  • devise 2.1
  • related 0.6.3

When user model inherit Related::Node will result 'raise_no_devise_method_error!' as below

require 'related/follower'

class User < Related::Node
  include Related::Follower
end

Error message when start rails

/Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/devise-2.1.0/lib/devise/rails/routes.rb:409:in 'raise_no_devise_method_error!': User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb' (RuntimeError)
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/devise-2.1.0/lib/devise/rails/routes.rb:210:in 'block in devise_for'
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/devise-2.1.0/lib/devise/rails/routes.rb:206:in 'each'
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/devise-2.1.0/lib/devise/rails/routes.rb:206:in 'devise_for'
from /Users/joshchang/repositories/tmp/foo/config/routes.rb:2 :in 'block in <top (required)>'
....

I try to add require 'devise/orm/active_record' in application.rb will result the other error.

/Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/orm_adapter-0.0.7/lib/orm_adapter/adapters/active_record.rb:8 :in '< module:OrmAdapter >': uninitialized constant OrmAdapter::Base (NameError)
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/orm_adapter-0.0.7/lib/orm_adapter/adapters/active_record.rb:7 :in `<top (required)>'

Is there any solutions? Thanks.

@niho
Copy link
Owner

niho commented Jun 16, 2012

Devise seems to require compatibility with the ORM you are using and does not include an adapter for Related by default. So when you only use Related in your app ActiveRecord is never loaded and Devise complains that it can't find any compatible ORM.

I will look into if it would be possible to get a Related adapter included in Devise. But since it is a completely separate project I can't give any guarantees.

@ghost ghost assigned niho Jun 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants