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:
@@ -193,7 +193,7 @@ class ForumTopic < ApplicationRecord
|
||||
|
||||
def merge(topic)
|
||||
ForumPost.where(:id => self.posts.map(&:id)).update_all(:topic_id => topic.id)
|
||||
topic.update_attributes(:response_count => topic.response_count + self.posts.length, :updater_id => CurrentUser.id)
|
||||
topic.update(response_count: topic.response_count + self.posts.length, updater_id: CurrentUser.id)
|
||||
self.update_columns(:response_count => 0, :is_deleted => true, :updater_id => CurrentUser.id)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user