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:
@@ -174,7 +174,7 @@ class FavoriteGroup < ApplicationRecord
|
||||
return if contains?(post_id)
|
||||
|
||||
clear_post_id_array
|
||||
update_attributes(:post_ids => add_number_to_string(post_id, post_ids))
|
||||
update(post_ids: add_number_to_string(post_id, post_ids))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -184,7 +184,7 @@ class FavoriteGroup < ApplicationRecord
|
||||
return unless contains?(post_id)
|
||||
|
||||
clear_post_id_array
|
||||
update_attributes(:post_ids => remove_number_from_string(post_id, post_ids))
|
||||
update(post_ids: remove_number_from_string(post_id, post_ids))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user