I have a Subscription model with a price field and my last migration introduced a field called per_month_price. I am looking for a method which can update records faster than a simple .each {...}. For example:
Subscription.update_all {|c| c.per_month_price = c.price/12}
why not simply use
This is working. It takes the statement and runs for all found records. This is very common in rails.
http://apidock.com/rails/ActiveRecord/Relation/update_all
Please check before downvote!