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

Can not save a user with nil tokens attribute #271

Closed
casertap opened this issue Jun 17, 2015 · 0 comments · Fixed by #306
Closed

Can not save a user with nil tokens attribute #271

casertap opened this issue Jun 17, 2015 · 0 comments · Fixed by #306

Comments

@casertap
Copy link

The chain of callbacks induce my devise_token_auth makes it impossible to save a user with a nil tokens.

NoMethodError: undefined method `delete_if' for nil:NilClass
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/devise_token_auth-0.1.32.beta9/app/models/devise_token_auth/concerns/user.rb:241:in `destroy_expired_tokens'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:164:in `call'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:164:in `block in halting'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:504:in `call'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:504:in `block in call'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:504:in `each'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:504:in `call'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:92:in `_run_callbacks'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:776:in `_run_save_callbacks'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/callbacks.rb:302:in `create_or_update'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/persistence.rb:142:in `save!'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/validations.rb:43:in `save!'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
        from /Users/pierrecaserta/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/transactions.rb:291:in `block in save!'
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

Successfully merging a pull request may close this issue.

1 participant