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

Devise initializer issue #17

Closed
lucasmazza opened this issue May 16, 2016 · 5 comments
Closed

Devise initializer issue #17

lucasmazza opened this issue May 16, 2016 · 5 comments

Comments

@lucasmazza
Copy link

Since to d395efd, both DeviseController and ApplicationController (its parent controller) are loaded inside an initializer, before the app has been completely loaded and in scenarios where loading the app isn't necessary (like during rake db:setup or rake routes tasks).

This isn't recommended and it can cause different loading order bugs that are hard for developers to track down. As current Devise maintainer, I recommend moving the configure_permitted_parameters callback back to the ApplicationController class.

Related Devise issue - heartcombo/devise#3757

@vanitu
Copy link

vanitu commented Aug 8, 2016

+1

@vanitu
Copy link

vanitu commented Aug 8, 2016

solve issue as
changing in config/initializers/devise_permitted_parameters.rb

from

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :name
devise_parameter_sanitizer.for(:account_update) << :name
end

to

def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up,keys: [:name])
devise_parameter_sanitizer.permit(:account_update,keys: [:name])
end

@kant01ne
Copy link

#18

@zachkrasner
Copy link

Thank you Vanitu!

@DanielKehoe
Copy link
Member

Sorry it took a bit of time to address this issue because of other responsibilities.

DanielKehoe added a commit that referenced this issue Oct 5, 2016
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

5 participants