Permalink
Browse files

Moving from update_attribute to update_column

  • Loading branch information...
iloveitaly committed Jul 30, 2012
1 parent 21e2cfd commit 25656b4ac75b12c3ed4d348118ce1fbf6bd72286
@@ -35,7 +35,7 @@ def update
else
new_address = @address.clone
new_address.attributes = params[:address]
- @address.update_attribute(:deleted_at, Time.now)
+ @address.update_column(:deleted_at, Time.now)
if new_address.save
flash[:notice] = t(:successfully_updated, :resource =>t(:address))
end
@@ -28,10 +28,10 @@ def normalize_addresses
if @order.bill_address_id != @order.ship_address_id && @order.bill_address.same_as?(@order.ship_address)
@order.bill_address.destroy
- @order.update_attribute(:bill_address_id, @order.ship_address.id)
+ @order.update_column(:bill_address_id, @order.ship_address.id)
else
- @order.bill_address.update_attribute(:user_id, current_user.try(:id))
+ @order.bill_address.update_column(:user_id, current_user.try(:id))
end
- @order.ship_address.update_attribute(:user_id, current_user.try(:id))
+ @order.ship_address.update_column(:user_id, current_user.try(:id))
end
end
@@ -34,7 +34,7 @@ def destroy
if can_be_deleted?
super
else
- update_attribute(:deleted_at, Time.now)
+ update_column(:deleted_at, Time.now)
end
end
end

0 comments on commit 25656b4

Please sign in to comment.