mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
correct monkey patch, disable it from rails4 mode (that has a proper implementation)
This commit is contained in:
parent
b40d15f81d
commit
3565f4c8cf
@ -11,10 +11,18 @@ class ActiveRecord::Base
|
|||||||
exec_sql(*args).cmd_tuples
|
exec_sql(*args).cmd_tuples
|
||||||
end
|
end
|
||||||
|
|
||||||
# note: update_attributes still spins up a transaction this can cause contention
|
# exists fine in rails4
|
||||||
# this method performs the raw update sidestepping the locking
|
unless rails4?
|
||||||
def update_columns(hash)
|
# note: update_attributes still spins up a transaction this can cause contention
|
||||||
self.class.where(self.class.primary_key => self.id).update_all(hash)
|
# this method performs the raw update sidestepping the locking
|
||||||
|
# exists in rails 4
|
||||||
|
def update_columns(hash)
|
||||||
|
self.class.where(self.class.primary_key => self.id).update_all(hash)
|
||||||
|
|
||||||
|
hash.each do |k,v|
|
||||||
|
raw_write_attribute k, v
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec_sql(*args)
|
def exec_sql(*args)
|
||||||
|
Loading…
Reference in New Issue
Block a user