loop update_attribute can be replaced by update_all
lelelelemon opened this issue · 1 comments
lelelelemon commented
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
seven1m commented
This code is not in OneBody. Did you mean to post this issue to another project?