rails 4 deprecation fixes
This commit is contained in:
parent
6fac09aeaa
commit
ff957a7b37
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue