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

DateTime nil not supported by neo4j #13

Open
jelmerderonde opened this issue Feb 28, 2015 · 7 comments
Open

DateTime nil not supported by neo4j #13

jelmerderonde opened this issue Feb 28, 2015 · 7 comments

Comments

@jelmerderonde
Copy link

I have never before submitted an issue on GitHub or anywhere else, so please let me know if I'm doing something wrong.

I am now working on integrating devise-neo4j with my app. After adding the recoverable property to my User model I ran into an issue. When submitting a new password, it returns the error that the year method is not supported by NilClass. It appears that devise tries to set the reset_password_at property to nil. Upon saving to the neo4j database this gives an error.

It seems to me that this is an issue for devise-neo4j, because it could be normal behaviour for both devise and neo4j, but I'm not sure.

Let me know what I can do to help fix this issue.

@benjackson
Copy link
Contributor

Hey @jelmerderonde. It would be good to know some more details about the error. Perhaps you could paste a gist showing it? Or a bare minimum example project that makes the error happen because the tests for Devise with neo4j all seem to be passing fine.

If you just wanted a quick-ish fix, you could try extending Recoverable and overwriting the after_password_reset method (which is empty in Devise's Recoverable module), to set whatever you need in order for the error not to occur.

@jelmerderonde
Copy link
Author

Hi @benjackson,

Thanks for the quick reply. A gist showing the rails server output when the error occurs: https://gist.github.com/jelmerderonde/2930788bfed7b80f4b2b

A minimum project would frankly be just rails, neo4j and devise-neo4j, with a single User resource with the Recoverable module. When a user tries to reset their password, because devise tries to set the reset_sent_at to nil which is not accepted.

I did some more research and I think it might be because of this commit in neo4jrb:
neo4jrb/activegraph@f8689b5#diff-3fa03f2e2089eba3ae28988a375ac16a

However I'm not sure of this. I will try to implement the fix you mentioned, but if you have any suggestion on what I can do to implement a more complete fix let me know.

@subvertallchris
Copy link
Contributor

Sorry for coming into this a little late. I'm still a little unsure about how it's getting to the point that it can try to convert a nil value. Do we know where reset_sent_at is defined?

@jelmerderonde
Copy link
Author

@benjackson
Copy link
Contributor

@jelmerderonde I haven't tried a real example yet, but any idea why this integration test that gets run as part of all the devise tests wouldn't suffer from the same issue you're seeing?:

https://github.com/plataformatec/devise/blob/master/test/integration/recoverable_test.rb

@jelmerderonde
Copy link
Author

@benjackson is there a way I can run these tests in the context of my app? I will take a look at it.

@benjackson
Copy link
Contributor

@jelmerderonde you could just recreate the integration test that covers the functionality that is breaking for you, but that might still be something attributable to your app rather than the gem.

If you're able to create an example in a public repo, with a failing integration test, I'd be happy to take a look and see if I can figure out why the Devise test doesn't capture the same problem.

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

3 participants