Change locking to use postgres syntax, fixes 'must be first statement in transaction' error

This commit is contained in:
Rohan Mitchell
2015-02-20 11:31:39 +11:00
parent 176db78e64
commit 4554c0555d

View File

@@ -2,7 +2,7 @@ module OpenFoodNetwork::Locking
# http://rhnh.net/2010/06/30/acts-as-list-will-break-in-production
def with_isolation_level_serializable
self.transaction do
self.connection.execute("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE")
self.connection.execute "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE"
yield
end
end