Skip to content
Browse files

Another fix related to change in Rails update_attribute.

  • Loading branch information...
1 parent f7655eb commit 28701477ed8d067fec49ed9b28244f0c94901fdb @schof schof committed Aug 1, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/app/controllers/orders_controller.rb
View
7 core/app/controllers/orders_controller.rb
@@ -83,9 +83,10 @@ def prevent_editing_complete_order
def set_user
#only if the user is blank and the order is in_progress
- if @order && @order.user.nil? && @order.in_progress?
- @order.checkout.update_attribute(:email, current_user && current_user.email) if @order.checkout
- @order.update_attribute(:user, current_user)
+ if @order && @order.user.nil? && @order.in_progress? && current_user
+ @order.checkout.update_attribute(:email, current_user.email) if @order.checkout
+ @order.user = current_user
+ @order.save
end
end

0 comments on commit 2870147

Please sign in to comment.
Something went wrong with that request. Please try again.