-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1466, override passwords controller from Devise
- Loading branch information
Marc Altmann
committed
Dec 10, 2015
1 parent
cc8385d
commit 6647535
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2012-2015, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
class PasswordsController < Devise::PasswordsController | ||
def update | ||
super | ||
|
||
# TODO: Remove duplicate code in passwords and sessions controllers | ||
if cart = Cart.find_by_id(cookies.signed[:cart]) | ||
cart.update_attribute :user_id, current_user.id unless cart.user_id | ||
else # user probably doesn't have cart cookie set | ||
@current_cart = Cart.current_for current_user | ||
cookies.signed[:cart] = @current_cart.id if @current_cart | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters