4533: Lock all tables, not just the ones with fixtures. refs #4533
authorTom Clegg <tom@curoverse.com>
Fri, 5 Dec 2014 18:24:49 +0000 (13:24 -0500)
committerTom Clegg <tom@curoverse.com>
Fri, 5 Dec 2014 18:24:49 +0000 (13:24 -0500)
services/api/app/controllers/database_controller.rb

index 831451435ef9f9adb47d974cdb91697f9db43f71..1e577ae54f410a84a680acd2ce4cb3a05f73599b 100644 (file)
@@ -32,7 +32,7 @@ class DatabaseController < ApplicationController
     ActiveRecord::Base.transaction do
       # Avoid deadlock by locking all tables before doing anything
       # drastic.
-      table_names = '"' + fixturesets.sort.join('","') + '"'
+      table_names = '"' + ActiveRecord::Base.connection.tables.join('","') + '"'
       ActiveRecord::Base.connection.execute \
       "LOCK TABLE #{table_names} IN ACCESS EXCLUSIVE MODE"