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

find_scope! fails when comparing if user.is_a?(User) #3665

Closed
andrewhavens opened this issue Jul 2, 2015 · 1 comment
Closed

find_scope! fails when comparing if user.is_a?(User) #3665

andrewhavens opened this issue Jul 2, 2015 · 1 comment

Comments

@andrewhavens
Copy link

I'm running a Rails 4.2 application, using the latest version of devise (3.5.1), latest version of devise-neo4j (2.0.0), and latest version of neo4j (5.0.2). As explained in neo4jrb/devise-activegraph#16, I am unable to call sign_in user because Devise.ref.name does not return User. Instead, it returns something that looks like this:

User(authentication_token: Object, confirmation_sent_at: DateTime, confirmation_token: Object, confirmed_at: DateTime, created_at: DateTime, current_sign_in_at: DateTime, current_sign_in_ip: Object, email: Object, encrypted_password: Object, facebook_token: Object, first_name: Object, last_name: Object, last_sign_in_at: DateTime, last_sign_in_ip: Object, remember_created_at: DateTime, reset_password_sent_at: DateTime, reset_password_token: Object, sign_in_count: Object, tos: Object, unconfirmed_email: Object, updated_at: DateTime)

It seems this has something to do with class caching. But I don't really understand how this works. So I'm having trouble trying to find a solution (or even identify how it is supposed to work). These lines seem to be the source of my issues:

ActiveSupport::Dependencies::reference(User)
ActiveSupport::Dependencies.constantize(User)

It's possible that this is a bug with the neo4j gem. However, if you know how this ActiveSupport::Dependencies::reference stuff is supposed to work and what I need to do to fix it, that would help.

Otherwise, as a workaround, if you could help me find a way of signing in a user and avoid those lines of code that are failing, that would be helpful too.

I'm really just trying to figure out how to move forward.

Thanks!

@josevalim
Copy link
Contributor

You need to give us a way to reproduce the issue, otherwise there isn't much we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants