diff --git a/lib/freedom_patches/active_record_base.rb b/lib/freedom_patches/active_record_base.rb index b8abe48a54a..f114315f89d 100644 --- a/lib/freedom_patches/active_record_base.rb +++ b/lib/freedom_patches/active_record_base.rb @@ -14,7 +14,7 @@ class ActiveRecord::Base # note: update_attributes still spins up a transaction this can cause contention # this method performs the raw update sidestepping the locking def update_columns(hash) - self.class.update_all(hash, self.class.primary_key => self.id) + self.class.where(self.class.primary_key => self.id).update_all(hash) end def exec_sql(*args) diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 559c3e8d970..d39ebdd91fa 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -112,9 +112,9 @@ class PostCreator def track_latest_on_category if @post && @post.errors.count == 0 && @topic && @topic.category_id - Category.update_all( {latest_post_id: @post.id}, {id: @topic.category_id} ) + Category.where(id: @topic.category_id).update_all(latest_post_id: @post.id) if @post.post_number == 1 - Category.update_all( {latest_topic_id: @topic.id}, {id: @topic.category_id} ) + Category.where(id: @topic.category_id).update_all(latest_topic_id: @topic.id) end end end diff --git a/vendor/gems/discourse_task/lib/discourse_task/plugin.rb b/vendor/gems/discourse_task/lib/discourse_task/plugin.rb index 20aa668bb40..4f105d2a7d1 100644 --- a/vendor/gems/discourse_task/lib/discourse_task/plugin.rb +++ b/vendor/gems/discourse_task/lib/discourse_task/plugin.rb @@ -70,10 +70,8 @@ module DiscourseTask topic.update_meta_data(complete: false) topic.add_moderator_post(current_user, I18n.t(:'task.reversed')) end - end - render nothing: true end