app/controllers/devise/registrations_controller.rb in devise-2.1.0.rc2 vs app/controllers/devise/registrations_controller.rb in devise-2.1.0
- old
+ new
@@ -37,11 +37,11 @@
# We need to use a copy of the resource because we don't want to change
# the current user in place.
def update
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
- if resource.update_with_password(params[resource_name])
+ if resource.update_with_password(resource_params)
if is_navigational_format?
if resource.respond_to?(:pending_reconfirmation?) && resource.pending_reconfirmation?
flash_key = :update_needs_confirmation
end
set_flash_message :notice, flash_key || :updated
@@ -75,10 +75,10 @@
protected
# Build a devise resource passing in the session. Useful to move
# temporary session data to the newly created user.
def build_resource(hash=nil)
- hash ||= params[resource_name] || {}
+ hash ||= resource_params || {}
self.resource = resource_class.new_with_session(hash, session)
end
# The path used after sign up. You need to overwrite this method
# in your own RegistrationsController.