seven1m/onebody

loop update_attribute can be replaced by update_all

lelelelemon opened this issue · 1 comments

app/controllers/application_controller.rb
129    session_cart.cart_items.each do |item|
130      item.update_attribute(:user_id, user.id ) if item.user_id != user.id
131   end
session_cart.cart_items.where.not(user_id: user.id).update_all(user_id: user.id)

I will make a pull request if you think this is worth doing

This code is not in OneBody. Did you mean to post this issue to another project?