Replace deprecated update_attributes with update.
https://rubyinrails.com/2019/04/09/rails-6-1-activerecord-deprecates-update-attributes-methods/ DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead)
This commit is contained in:
@@ -13,6 +13,6 @@ dead_post_ids = all_post_ids - live_post_ids
|
||||
|
||||
dead_post_ids.each do |post_id|
|
||||
Pool.where("post_ids like '? %' or post_ids like '% ? %' or post_ids like '% ?'", post_id, post_id, post_id).find_each do |pool|
|
||||
pool.update_attributes(:post_ids => pool.remove_number_from_string(post_id, pool.post_ids), :post_count => pool.post_count - 1)
|
||||
pool.update(post_ids: pool.remove_number_from_string(post_id, pool.post_ids), post_count: pool.post_count - 1)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user