1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

SessionsController#destroy no longer yields the resource object.

If you need access to the current resource when overring the action
use the scope helper (like `current_user`) before calling `super`.

Closes #2926.
This commit is contained in:
Lucas Mazza 2014-03-17 11:51:25 -03:00
parent 755219ccfc
commit 1eab594895
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,11 @@
### Unreleased
* fixes
* `SessionsController#destroy` no longer yields the `resource` to receiving block,
since the resource isn't loaded in the action. If you need access to the current
resource when overring the action use the scope helper (like `current_user`) before
calling `super`.
### 3.2.4
* enchancements

View file

@ -24,7 +24,7 @@ class Devise::SessionsController < DeviseController
redirect_path = after_sign_out_path_for(resource_name)
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
set_flash_message :notice, :signed_out if signed_out && is_flashing_format?
yield resource if block_given?
yield if block_given?
# We actually need to hardcode this as Rails default responder doesn't
# support returning empty response on GET request